﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
 用户管理
 
</title><link href="../Styles/css.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="../css/style.css"/>
    <script src="../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="../Scripts/IndexManager.js" type="text/javascript"></script>
   <!--  <script src="../Scripts/selectProject.js" type="text/javascript"></script> -->
    <!-- <script type="text/javascript">
        function openWin() {

            showModalDialog("WorkingTimeUpdateManager.htm", "example04", "dialogWidth:600px;dialogHeight:300px;dialogLeft:200px;dialogTop:150px;center: yes;help:yes;resizable:yes;status:yes")
        }

    </script> -->
</head>
<body style="margin-top: 5px; background: #EFF3FF;">
    <form method="post" action="tomohu.do" id="form1">

    <div id="divOne">
        <div>
            <table width="100%">
                <tr id="ProjectsType">
	<td width="7%">
                        用户姓名：
                    </td>
	<td width="15%">
                        <input name="name" type="text" id="name"   style="width:95%;" />
                    </td>
     <td width="7%">
                        电话号码：
                    </td>
	<td width="15%">
                        <input name="tel" type="text" id="tel"   style="width:95%;" />
                    </td>               
                 
      <td width="10%" class="table_list1_style1">
                    <font class="red"></font> 角色
                </td>            
                    
             <td width="20%" class="table_list1_style2">
                    <select name="rolId" id="rolId" style="width: 90%;">
                      <!--   <option selected="selected" value="1">销售员</option>
                        <option value="2">管理员</option>     --> 
                    </select>
                </td>
                
                       
	<td width="10%">
                        <input style="border-style: none; border-color: inherit; border-width: 0px; background-image: url('../Images/search.gif'); width: 100px; height: 24px;" 
                            type="submit" value=""/>
                    </td>
	 <td align="right"> 
	 
                       <!--  <input type="button" id="btnAdd" class="button" value="添加" /> -->
        <span class="l_f">
        <a href="Adduser.do"  id="" title="添加用户" class="btn btn-warning Order_form"><i class="fa fa-plus"></i> 添加用户</a>
       </span>
                   </td> 
</tr>
 
            </table>
            
         
         
        </div>
        </form>
        
        <form  method="post" action="WorkingTimeManager.htm" id="form2">
        <div class="cxlb_2" id="indexs">
            <table width="100%" class="tablist">
                <thead>
                    <tr>
                        <th width="20%">
                           用户名
                        </th>
                        <th width="15%">
                           密码
                        </th>
                        <th width="15%">
                            用户姓名
                        </th>
                        <th width="15%">
                           联系方式
                        </th>
                        <th width="15%">
                          修改时间
                        </th>
                        <th width="">
                            角色
                        </th>
                                  <th width="15%">
                           操作
                        </th>
                    </tr>
                </thead>
                <tbody id="tab">
                
            <c:forEach items="${list }" var="bean">
			<tr>
	       <td>${bean.name }</td>
	       <td>${bean.password }</td>
	        <td>${bean.name }</td>
	       <td>${bean.tel }</td>
	       <td><f:formatDate value="${bean.updateTime }" pattern="YYYY-MM-dd" />  </td>
	       <c:if test="${bean.rolId == 1 }">
		       <td>销售员</td>
	       </c:if>
			 <c:if test="${bean.rolId == 2 }">
		       <td>管理员</td>
	       </c:if>
	          <td width="">
                <a title="编辑"  href="updateuser.do?userID=${bean.userId}">
                                        修改</a>
                                        
                <a href="javascript:void(0);" onclick="userdele('${bean.userId}')">
                                        删除</a>
              </td>
                 
                         
                                            
                                
                                
	     <!-- 	<td class="td-manage">
		        <a title="编辑" onclick="member_edit('编辑','member-add.html','4','','510')" href="javascript:;"  class="btn btn-xs btn-info" ><i class="fa fa-edit bigger-120">编辑</i></a>      
		        <a title="删除" href="#"  onclick="return confirm('确定要删除么?')" class="btn btn-xs btn-warning" ><i class="fa fa-trash  bigger-120">作废</i></a>
	      	 </td> -->
     	 </tr>
		</c:forEach>
                        
                      
                        
                </tbody>
                <tr>
                    
                </tr>
            </table>
 <script type="text/javascript">
       $(function () {
       
      var value1= '1';
	              $.ajax({
    url:'../role/selectrole2.do',
    type:'POST', //GET
    async:true,    //或false,是否异步 true为异步
    data:{
        'yanz':value1
    },
    timeout:5000,    //超时时间
    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
   
    success:function(data){
         var com = data.complexList;
        
         if(com!=""){
            
            document.getElementById('rolId').innerHTML =com; 
             
         }else{
                alert('没有结果');
         }
        
       
    }
    
   
})
	  
	  
	  });
   
</script>             
            
            
<script type="text/javascript">

		 
var message="${message}";
if(message.length!=0){
	 alert(message);
	  $(function () {
	              $.ajax({
    url:'name2.do',
    type:'POST', //GET
    async:true,    //或false,是否异步 true为异步
    data:{
        'yanz':'zz'
    },
    timeout:5000,    //超时时间
    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
   
    success:function(data){
         var com = data.fhui;
        
         if(com=='清除成功'){
           
         }else{
  
         }
        
       
    }
    
   
})
	  
	  
	  });
}


    function userdele(userID) {
       alert(userID);
       if(confirm("确定要删除吗？")){
          location.href="toudele.do?userID="+userID;
          
    }
       
    
    
    }
           
</script>            
            
            
            <script type="text/javascript">
<!--
                var Ptr = document.getElementById("tab").getElementsByTagName("tr");
                function pageLoad() {
                    for (i = 1; i < Ptr.length + 1; i++) {
                        Ptr[i - 1].className = (i % 2 > 0) ? "t1" : "t2";
                    }
                }
                window.onload = pageLoad;
                for (var i = 0; i < Ptr.length; i++) {
                    Ptr[i].onmouseover = function () {
                        this.tmpClass = this.className;
                        this.className = "t3";

                    };
                    Ptr[i].onmouseout = function () {
                        this.className = this.tmpClass;
                    };
                }
//-->
            </script>
        </div>
        <div id="pageType">
            
<!-- AspNetPager 7.3.2  Copyright:2003-2010 Webdiyer (www.webdiyer.com) -->
<div id="AspNetPager1" class="anpager" style="width:100%;text-align:left;">
<div align="left" class="anpager" style="width:60%;float:left;">
	<a disabled="disabled" style="margin-right:10px;">首页</a><a disabled="disabled" style="margin-right:10px;">上一页</a><span class="cpb" style="margin-right:10px;">1</span><a disabled="disabled" style="margin-right:10px;">下一页</a><a disabled="disabled" style="margin-right:10px;">尾页</a>
</div><div class="anpager" style="width:40%;float:left;">
	记录总数：<font color="blue"><b>8</b></font> 总页数：<font color="blue"><b>1</b></font> 当前页：<font color="red"><b>1</b></font>
</div>
</div>
<!-- AspNetPager 7.3.2  Copyright:2003-2010 Webdiyer (www.webdiyer.com) -->
 
 
        </div>
    </div>
    <input type="hidden" name="hidProductIdSelect" id="hidProductIdSelect" />
    </form>
</body>
</html>
